package cn.hust.springboot.bean;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

/**
 * @desc:数据导出，生成excel文件时的列名称集合
 * @author: chao
 * @time: 2022.7.1
 */
public class ColumnTitleMap {
    private Map<String, String> columnTitleMap = new HashMap<String, String>();
    private ArrayList<String> titleKeyList = new ArrayList<String> ();

    public ColumnTitleMap(String datatype) {
        switch (datatype) {
            case "emp":
                initUserInfoColu();
                initUserInfoTitleKeyList();
                break;
            default:
                break;
        }

    }
    /**
     * mysql用户表需要导出字段--显示名称对应集合
     *
     *
     */
    private void initUserInfoColu() {
        columnTitleMap.put("id", "员工编号");
        columnTitleMap.put("name", "姓名");
        columnTitleMap.put("age", "年龄");
        columnTitleMap.put("gender", "性别");
        columnTitleMap.put("birthday", "生日");
        columnTitleMap.put("IDCard", "身份证");
        columnTitleMap.put("wedlock", "婚姻状况");
        columnTitleMap.put("nationId", "民族");
        columnTitleMap.put("nativePlace", "籍贯");
        columnTitleMap.put("email", "邮箱");
        columnTitleMap.put("phone", "电话");
        columnTitleMap.put("address", "地址");
        columnTitleMap.put("deptId", "所属部门");
        columnTitleMap.put("posId", "职位ID");
        columnTitleMap.put("degree", "最高学历");
        columnTitleMap.put("school", "毕业院校");
        columnTitleMap.put("edate", "入职日期");
        columnTitleMap.put("workState", "在职状态");
        columnTitleMap.put("workID", "工号");
        columnTitleMap.put("conversionTime", "转正日期");
        columnTitleMap.put("workAge", "工龄");
        columnTitleMap.put("leaveTime", "离职日期");
        columnTitleMap.put("leaveReason", "离职原因");
        columnTitleMap.put("chgDeptTime", "部门调动时间");
        columnTitleMap.put("chgPosTime", "岗位调动时间");
    }


    /**
     * mysql用户表需要导出字段集
     */
    private void initUserInfoTitleKeyList() {
        titleKeyList.add("id");
        titleKeyList.add("name");
        titleKeyList.add("age");
        titleKeyList.add("gender");
        titleKeyList.add("birthday");
        titleKeyList.add("IDCard");
        titleKeyList.add("wedlock" );
        titleKeyList.add("nationId");
        titleKeyList.add("nativePlace");
        titleKeyList.add("email");
        titleKeyList.add("phone");
        titleKeyList.add("address");
        titleKeyList.add("deptId" );
        titleKeyList.add("posId");
        titleKeyList.add("degree" );
        titleKeyList.add("school" );
        titleKeyList.add("edate");
        titleKeyList.add("workState" );
        titleKeyList.add("workID");
        titleKeyList.add("conversionTime");
        titleKeyList.add("workAge");
        titleKeyList.add("leaveTime" );
        titleKeyList.add("leaveReason" );
        titleKeyList.add("chgDeptTime");
        titleKeyList.add("chgPosTime");

    }

    public Map<String, String> getColumnTitleMap() {
        return columnTitleMap;
    }

    public ArrayList<String> getTitleKeyList() {
        return titleKeyList;
    }
}
